<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="${packageName}.${moduleName}.dao.${className}Mapper">
	<insert id="add" parameterType="${packageName}.${moduleName}.bean.pojo.${className}">
		INSERT INTO ${tableName}
		(<#list colList as col>${col.colName}<#if colList?size-1!=col_index>,</#if></#list>)
		values 
		(<#list colList as col>#${'{'}${col.fieldName}}<#if colList?size-1!=col_index>,</#if></#list>)
	</insert>
	<delete id="delete" >
		DELETE FROM ${tableName} where
		${firstCol}=#${'{'}${firstParam}}
	</delete>
	<update id="update" parameterType="${packageName}.${moduleName}.bean.pojo.${className}">
		UPDATE ${tableName} SET
		<trim prefixOverrides=",">  
		 <#list colList as col>
		 	<#if 0!=col_index>
		 		 <if test="${col.fieldName} != null">,${col.colName}=#${'{'}${col.fieldName}}</if></#if>
		 </#list>
		 </trim>
		 WHERE ${firstCol}=#${'{'}${firstParam}}
	</update>
</mapper>